package com.xiaoshuidi.cloud.module.contract.controller.admin.contract;

import com.xiaoshuidi.cloud.framework.common.pojo.CommonResult;
import com.xiaoshuidi.cloud.framework.common.pojo.PageResult;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.ContractChangingRoomsRecordPageReq;
import com.xiaoshuidi.cloud.module.contract.controller.admin.contract.vo.ContractChangingRoomsRecordPageResp;
import com.xiaoshuidi.cloud.module.contract.enums.ApiConstants;
import com.xiaoshuidi.cloud.module.contract.service.contract.ContractChangingRoomsRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 换房记录
 *
 * @Author Feng
 * @date 2023/7/3
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(ApiConstants.NAME + "/changing-rooms-record")
public class ContractChangingRoomsRecordController {

    private final ContractChangingRoomsRecordService contractChangingRoomsRecordService;

    /**
     * 换房记录-列表
     *
     * @param req
     * @return
     */
    @GetMapping("/page")
    public CommonResult<PageResult<ContractChangingRoomsRecordPageResp>> page(ContractChangingRoomsRecordPageReq req) {
        return CommonResult.success(contractChangingRoomsRecordService.page(req));
    }
}
